package com.feri.ssm.controller;

import com.feri.ssm.entity.User;
import com.feri.ssm.service.intf.UserService;
import com.feri.ssm.vo.PageBean;
import com.feri.ssm.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Feri
 * @date 2021/12/13 15:34
 * @description:TODO
 */
@Controller //IOC创建
@RequestMapping("/api/user/")
public class UserController {
    @Autowired
    private UserService service;

    @RequestMapping("save.do")
    @ResponseBody
    public R save(User user){
        return service.save(user);
    }

    @RequestMapping("all.do")
    @ResponseBody
    public PageBean all(int page, int limit){
        return service.queryAll(page, limit);
    }



}
